package homework;

public class work04 {
	public static void main(String[] args){
		for (int i = 1; i <= 1001; i++){
			if (!su(i)){
				continue;
			}
			if (huiwei(i)){
				System.out.println(i+" ");
			}
		}
	}
	private static boolean su(int num){
		int sq = (int) Math.sqrt(num);
		for (int j = 2; j < sq + 1; j++){
			if (num % j == 0){
				return false;
			}
		}
	return true;
	}
	private static boolean huiwei(int num){
		int i;
		if (num < 99){
			i= num / 10;
		}else
		{
			i = num / 100;
		}
	return i == num % 10;
	}
}
